package com.lbd.system.service.impl;

import com.lbd.system.bean.Recruitment;
import com.lbd.system.dao.RecruitmentRepository;
import com.lbd.system.service.RecruitmentService;
import com.lbd.base.service.BaseServiceImpl;
import org.apache.log4j.Logger;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.jpa.domain.Specification;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.Map;


@Service
@Transactional
public class RecruitmentServiceImpl extends BaseServiceImpl<Recruitment, RecruitmentRepository> implements RecruitmentService {
    private final Logger log = Logger.getLogger(this.getClass());
    @Autowired
    RecruitmentRepository recruitmentRepository;

    @Override
    public Specification<Recruitment> getSpecification(Recruitment recruitment) {
        return null;
    }

    /**
     * 构建查询语句和参数
     *
     * @param recruitment
     * @param parameter
     * @return
     */
    @Override
    public String buildJpql(Recruitment recruitment, Map<String, Object> parameter) {
        StringBuilder jpqlBuilder = new StringBuilder(" select new Recruitment(id,jobType,state) from  Recruitment t   ");
        if (recruitment != null) {

        }
        jpqlBuilder.append(" order by createdDate desc ");
        return jpqlBuilder.toString();
    }


}
